<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			window.onload = function()
			{
				let input = document.querySelectorAll('input');
				let a = document.querySelector('#a');
				let b = document.querySelector('#b');
				let c = document.querySelector('#c');
				
				a.onclick = function()
				{
					TickAll();
				}
				
				b.onclick = function()
				{
					TickNone();
				}
				
				c.onclick = function()
				{
					TickBack();
				}
				
				function TickAll()
				{
					for(let i = 0; i < input.length ; i++)
					{
						input[i].checked = true;
					}
				}
				
				function TickNone()
				{
					for(let i = 0; i < input.length ; i++)
					{
						input[i].checked = false;
					}
				}
				
				function TickBack()
				{
					for(let i = 0; i < input.length ; i++)
					{
						if(input[i].checked == true)
						{
							input[i].checked = false;
						}
						else
						{
							input[i].checked = true;
						}
					}
				}
			}
		</script>
	</head>
	<body>
		<button id="a">全选</button>
		<button id="b">不选</button>
		<button id="c">反选</button>
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
		
		<div>
			<input type="checkbox">
		</div>
	</body>
</html>